<!-- 消息 -->
<template>
  <div class="message">
    <van-nav-bar title="信息中心" />
    <van-cell-group>
      <van-notice-bar
        left-icon="volume-o"
        text="上网不涉密，涉密不上网。保护国家安全，涉密被抓要杀头！"
      />
      <van-cell value="驳回信息"/>
<van-empty
  ref="empty"
  v-show="show"
  class="custom-image"
  image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
  description="没有信息哦！"
/>
     <div :data="reason" v-for="item in reason" :key="item.id">
        <van-card
        :desc="item.reason"
        title="驳回原因"
        thumb="https://gitee.com/cuckoo-of-life/imgs/raw/master/20211118212242.png"
      />
     </div>
    </van-cell-group>
  </div>
</template>

<script>
import Vue from 'vue'
import axios from 'axios'
Vue.use(axios)
export default {
    created() {
    this.confirm_login();
    this.infoshow();
  },
  data() {
    return {
      reason:[],
      infonum:'',
      show:true
    }
  },
  methods: {
    infoshow() {
      const that = this;
      var token = sessionStorage.getItem('token')
      axios.post('http://39.96.36.251/api/ower/bohui',{
        token:token
      })
      .then(function(res){
        that.reason = res.data.data
        if(that.reason.length == 0){
          that.show = true
          // console.log(that.$refs.empty);
          // this.$refs.empty.style.display = "none"
        }else if (that.reason.length > 0){
          that.show = false
          // console.log(that.$refs.empty);
          // this.$refs.empty.style.display = "block"
        }
      })
    },
    confirm_login() {
      const token = sessionStorage.getItem('token')
      if(token == null){
        this.$router.replace('/login')
      }
    },
  }
}
</script>


<style scoped>

</style>
